﻿/****************
*
* Getting Started
*
*****************/

Phoenix needs much less setup code than a normal WP7 app, because we take care of a lot of the bootstrapping for you. There are a few steps you need to take to get things running though!

The following Steps are required:
 - Replace your App.xaml and App.xaml.cs with the code below (if you have custom code, then migrate that over into the below code)
 - Delete MainPage.xaml (or migrate the view contents into the Index.xaml view)
 - Verify the startup Uri in your WMAppManifest.xml is 'Shell.xaml'
 - (optional) Delete the splashscreen. There should be no reason the app startup should be slow enough to need one!
 - Exclude (don't delete) this file, otherwise when you update the quickstart package, it will come back :)

See http://phoenixframework.codeplex.com/documentation for more help

/***********************
* Begin Copying App.xaml 
************************/

<Phoenix:PhoenixApplication x:Class="$rootnamespace$.App"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:Phoenix="clr-namespace:Phoenix;assembly=Phoenix">
    <Application.ApplicationLifetimeObjects>
        <shell:PhoneApplicationService />
    </Application.ApplicationLifetimeObjects>
</Phoenix:PhoenixApplication>

/*********************
* End Copying App.xaml
**********************/

/**************************
* Begin Copying App.xaml.cs 
***************************/
using System;
using System.Windows;
using Microsoft.Phone.Shell;

namespace $rootnamespace$
{
    public partial class App
    {
        public App()
        {
            UnhandledException += Application_UnhandledException;
            InitializeComponent();

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode, 
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }
        }

        // Code to execute on Unhandled Exceptions
        private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
        {
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // An unhandled exception has occurred; break into the debugger
                System.Diagnostics.Debugger.Break();
            }
        }

		// Used for reporting errors/exceptions in your app when it is out in the wild
		public override string DeveloperEmailAddress
        {
            get { return YOUR_EMAIL_ADDRESS; }
        }

		protected override void ConfigurePhoenixHostBuilder(IPhoenixHostBuilder hostBuilder)
        {
            // You can configure Phoenix's behaviour from this point
        }

        public override void WriteTrace(string formattedMessage, string category)
        {
            Debug.WriteLine(formattedMessage);
        }
    }
}

/************************
* End Copying App.xaml.cs 
*************************/


